const timeDiffer = function (timestamp) {
  let time = timestamp.split('__DATE__')[1]
  time = parseInt(time)
  let newDate = new Date().getTime() - time
  let day = newDate / 1000 / 60 / 60 / 24
  if (day > 7) {
    return new Date(time).format('yyyy-MM-dd') + '创建'
  } else if (day <= 7 && day > 1) {
    return `${Math.floor(day)}天前创建`
  } else {
    let hours = newDate / 1000 / 60 / 60
    if (hours < 1) {
      return '刚刚发布'
    } else {
      return `${Math.floor(hours)}小时前创建`
    }
  }
}
export {
  timeDiffer
}